package com.yegs.admin.business.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yegs.admin.base.BaseEntity;
import org.springframework.data.annotation.Transient;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author yegs
 * @since 2020-08-22
 */
public class BaseUser extends BaseEntity<BaseUser> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId;

    /**
     * 登录账号
     */
    private String userLoginid;

    /**
     * 名字
     */
    private String userUsername;

    /**
     * 密码
     */
    private String userPassword;

    /**
     * 性别
     */
    private String userSex;

    /**
     * 电话号码
     */
    private String userPhone;

    /**
     * 上次登录时间
     */
    private Date userLasttime;

    /**
     * 创建者
     */
    private Integer userRefCreateby;


    @TableField(exist = false)
    private List<BaseRole> baseRoles;

    public List<BaseRole> getBaseRoles() {
        return baseRoles;
    }

    public void setBaseRoles(List<BaseRole> baseRoles) {
        this.baseRoles = baseRoles;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    public String getUserLoginid() {
        return userLoginid;
    }

    public void setUserLoginid(String userLoginid) {
        this.userLoginid = userLoginid;
    }
    public String getUserUsername() {
        return userUsername;
    }

    public void setUserUsername(String userUsername) {
        this.userUsername = userUsername;
    }
    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }
    public String getUserSex() {
        return userSex;
    }

    public void setUserSex(String userSex) {
        this.userSex = userSex;
    }
    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public Date getUserLasttime() {
        return userLasttime;
    }

    public void setUserLasttime(Date userLasttime) {
        this.userLasttime = userLasttime;
    }

    public Integer getUserRefCreateby() {
        return userRefCreateby;
    }

    public void setUserRefCreateby(Integer userRefCreateby) {
        this.userRefCreateby = userRefCreateby;
    }

    @Override
    protected Serializable pkVal() {
        return this.userId;
    }

    @Override
    public String toString() {
        return "BaseUser{" +
                "userId=" + userId +
                ", userLoginid='" + userLoginid + '\'' +
                ", userUsername='" + userUsername + '\'' +
                ", userPassword='" + userPassword + '\'' +
                ", userSex='" + userSex + '\'' +
                ", userPhone='" + userPhone + '\'' +
                ", userLasttime=" + userLasttime +
                ", userRefCreateby=" + userRefCreateby +
                '}';
    }
}
